﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

using CSF.Customers.Data;
using CSF.Customers.BLL;
using CSF.Customers.Service;

namespace CSF.Service.Accounts
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“ContactTypeSvc”。
    public class ContactTypeSvc : IContactTypeSvc
    {

        #region IDataCodeKeyService<ContactType> 成员

        public bool UpdateByCode(ContactType t, string code)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.UpdateByCode(t, code);
        }

        public bool DeleteOneByCode(string code)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.DeleteOneByCode(code);
        }

        #endregion

        #region IDataEntityService<ContactType> 成员

        public List<ContactType> GetAll()
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.GetAll();
        }

        public bool Insert(ContactType entity)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.Insert(entity);
        }

        #endregion

        #region IDataConfigService<ContactType> 成员

        public ContactType GetOneByCode(string code)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.GetOneByCode(code);
        }

        public List<ContactType> GetEnable()
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.GetEnable();
        }

        public List<ContactType> GetDisable()
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.GetDisable();
        }

        public List<ContactType> GetStartsWith(string keyword, bool isDisable)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.GetStartsWith(keyword, isDisable);
        }

        public bool Enable(ContactType t)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.Enable(t);
        }

        public bool Disable(ContactType t)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.Disable(t);
        }

        #endregion

        #region IDataCodeKeyService<ContactType> 成员


        public int DeleteByCode(IEnumerable<string> codes)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.DeleteByCode(codes);
        }

        #endregion

        #region IDataCodeKeyConfigService<ContactType> 成员

        public int SetDisable(IEnumerable<string> codes, bool isDisable, string modifyBy)
        {
            ContactTypeBLL bll = new ContactTypeBLL();
            return bll.SetDisable(codes, isDisable, modifyBy);
        }

        #endregion
    }
}
